﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		ResourceManagerHelper.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 // 
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion

using System.Web.Mvc;
using Dexter.Dependency;
using Dexter.Web.Mvc.ResourceCombiner;

namespace Dexter.Web.Mvc.Helpers {
	public static class ResourceManagerHelper {
		public static void AddJs ( this HtmlHelper helper , string source ) {
			ICombiner combiner = DexterContainer.Resolve <ICombiner> ( );

			combiner.AddJavascript ( source );
		}

		public static void AddCss ( this HtmlHelper helper , string source ) {
			ICombiner combiner = DexterContainer.Resolve<ICombiner> ( );

			combiner.AddStylesheet ( source );
		}

		public static MvcHtmlString RenderCssCombined ( this HtmlHelper helper ) {
			ICombiner combiner = DexterContainer.Resolve<ICombiner> ( );

			return MvcHtmlString.Create ( combiner.RenderCssCombined ( ) );
		}

		public static MvcHtmlString RenderJsCombined ( this HtmlHelper helper ) {
			ICombiner combiner = DexterContainer.Resolve<ICombiner> ( );

			return MvcHtmlString.Create ( combiner.RenderJsCombined ( ) );
		}
	}
}
